feat(contracts): extract admin functions and emit AdminParamsChanged events#125
Merged
PeterOche merged 2 commits intodegenspot:mainfrom Mar 24, 2026
Merged
Conversation
|
@phertyameen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@phertyameen some checks were not successful |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts all administrative functions into
admin.rsand replaces theexisting per-field events with a single unified
AdminParamsChangedeventso the indexer can subscribe to one topic and be notified of any admin
parameter mutation.
Changes
src/admin.rs(new file)set_admin- transfer admin privilegesset_outcome_manager- replace outcome managerset_fee- set protocol fee in basis points (new), guards againstvalues > 10,000 (100%)
src/events.rsemit_admin_changed/emit_outcome_manager_changedwithemit_admin_params_changed_addressandemit_admin_params_changed_u32("call_registry", "admin_params_changed")PARAM_ADMIN,PARAM_OUTCOME_MANAGER,PARAM_FEE_BPSconstants for the indexer to match against without magic strings
src/types.rsfee_bps: u32toContractConfig(default0ininitialize)src/lib.rsmod adminset_admin/set_outcome_managertoadmin.rsset_feeentry-pointfee_bps: 0ininitializeEvent schema
paramSymboladmin,outcome_manager,fee_bpschanged_byAddressold_valueAddress|u32new_valueAddress|u32Testing
set_admin- config updated, event payload correctset_outcome_manager- config updated, event payload correctset_fee- config updated, event payload correctset_fee(0)- validset_fee(10_000)- valid boundaryset_fee(10_001)- panics with expected messagecargo test)Closes #120